package cn.gov.pbc.gd.credit.vo.center.query;

import java.io.Serializable;
import java.io.UnsupportedEncodingException;
import java.net.URLEncoder;
import java.util.Map;

import com.liu.tools.StrUtil;

/**
 * @author liuxingmi
 * @datetime 2017年6月13日 上午10:21:35
 * @desc 司法查询
 */
public class ReqCCJusticeVo implements Serializable{

	/**
	 * 
	 */
	private static final long serialVersionUID = -856191359336493026L;

	private String id;
	
	private String querylog = "yes";
	
	private String vertype = "23";
	
	private String queryreason = "09";
	
	private String certtype;
	
	private String certno;
	
	private String name;

	private Map<String, String> cookies;
	
	public String getQuerylog() {
		return querylog;
	}

	public void setQuerylog(String querylog) {
		this.querylog = querylog;
	}

	public String getVertype() {
		return vertype;
	}

	public void setVertype(String vertype) {
		this.vertype = vertype;
	}

	public String getQueryreason() {
		return queryreason;
	}

	public void setQueryreason(String queryreason) {
		this.queryreason = queryreason;
	}

	public String getCerttype() {
		return certtype;
	}

	public void setCerttype(String certtype) {
		this.certtype = certtype;
	}

	public String getCertno() {
		return certno;
	}

	public void setCertno(String certno) {
		this.certno = certno;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public Map<String, String> getCookies() {
		return cookies;
	}

	public void setCookies(Map<String, String> cookies) {
		this.cookies = cookies;
	}

	public String getId() {
		return id;
	}

	public void setId(String id) {
		this.id = id;
	}


	public String toParams(String enc) {
		
		try {
			if(StrUtil.isNotNull(name)){
				name = URLEncoder.encode(name,"GBK");
			}
			
			if(StrUtil.isNotNull(certno)){
				certno = URLEncoder.encode(certno, enc);
			}
		} catch (UnsupportedEncodingException e) {
			
		}
		
		return ("querylog=" + querylog + "&vertype=" + vertype + "&queryreason=" + queryreason
				+ "&certtype=" + certtype + "&certno=" + certno + "&name=" + name + "").replaceAll("null", "");
	}
	
	
}
